package cn.stylefeng.guns.modular.api.controller;

import cn.stylefeng.guns.modular.ctm.entity.JobNotice;
import cn.stylefeng.guns.modular.ctm.service.JobNoticeService;
import cn.stylefeng.roses.core.base.controller.BaseController;
import cn.stylefeng.roses.core.reqres.response.ResponseData;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * 公告管理
 */
@Controller
@RequestMapping("/api/notice")
@Api(tags = "岗位公告")
@CrossOrigin
public class ApiNoticeController extends BaseController {

    @Autowired
    private JobNoticeService jobNoticeService;
    private Logger log = LoggerFactory.getLogger(this.getClass());

    @GetMapping(value = "/page")
    @ApiOperation(value = "公告分页列表", notes = "公告分页列表")
    @ResponseBody
    public ResponseData page(Page page, JobNotice jobNotice) {
        return ResponseData.success(jobNoticeService.selectByPage(page, jobNotice));
    }

    @GetMapping(value = "/{noInputId}")
    @ApiOperation(value = "公告详情", notes = "公告详情")
    @ResponseBody
    public ResponseData selectInfoById(@PathVariable("noInputId") String id) {
        return ResponseData.success(jobNoticeService.selectInfoById(id));
    }

}